#include"../../client/rpc_client.hpp"

void Callback(const string&key,const string&msg)
{
    ILog("%s 主题收到推送的消息: %s",key.c_str(),msg.c_str());
}
int main()
{
    //实例化客服端
    auto client=make_shared<Client::TopicClient>("127.0.0.1",9090);
    // 创建主题
    bool ret=client->Create("hello");
    if(ret==false) 
    {
        ELog("创建主题失败");
        
    }
    //订阅主题
    ret=client->Subscribe("hello",Callback);

    //等待退出
    this_thread::sleep_for(chrono::seconds(10));
    client->Shutdown();

    return 0;
}